# Maintainer: Alexey Pavlov <alexpux@gmail.com>

pkgname=perl-libwww
pkgver=6.41
pkgrel=1
pkgdesc="The World-Wide Web library for Perl"
arch=('any')
url="https://metacpan.org/release/libwww-perl"
groups=('perl-modules')
license=('PerlArtistic' 'GPL')
options=('!emptydirs')
depends=('perl' 'perl-Encode-Locale' 'perl-File-Listing'
         'perl-HTML-Parser' 'perl-HTTP-Cookies' 'perl-HTTP-Daemon'
         'perl-HTTP-Date' 'perl-HTTP-Negotiate' 'perl-LWP-MediaTypes'
         'perl-Net-HTTP' 'perl-URI' 'perl-WWW-RobotRules'
         'perl-HTTP-Message' 'perl-Try-Tiny')
optdepends=('perl-LWP-Protocol-https: for https:// url schemes')
checkdepends=('perl-Test-Fatal' 'perl-Test-Requiresinternet')
source=(https://cpan.metacpan.org/authors/id/O/OA/OALDERS/libwww-perl-${pkgver}.tar.gz)
sha256sums=('8e271add59a2b773839b902a58a9c955b42008700df93eae1aa37167483a064a')

build() {
  cd libwww-perl-${pkgver}
  perl Makefile.PL INSTALLDIRS=vendor
  make
}

check()  {
  cd libwww-perl-${pkgver}
  make test
}

package() {
  cd libwww-perl-${pkgver}
  make DESTDIR="$pkgdir" install
}
